package com.heima.behavior.feign;

import com.heima.behavior.dto.ArticleDto;
import com.heima.behavior.entity.ApArticle;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 文章信息表，存储已发布的文章 前端控制器
 * </p>
 *
 * @author mcm
 * @since 2022-01-15
 */
@FeignClient(value = "leadnews-article")
public interface ApArticleController {

    @PostMapping("/api/v1/article")
    public ResponseResult<Long> saveArticle(@RequestBody ArticleDto dto);

    @PostMapping("/api/v1/article/{id}")
    public ApArticle selectArticleById(@PathVariable("id") Long id);

    @PostMapping("/api/v1/article/save")
    public ResponseResult selectArticleById(@RequestBody ApArticle apArticle);
}
